package com.softeem.musicserver.controller;

import com.softeem.musicserver.dto.R;
import com.softeem.musicserver.entity.Musiclist;
import com.softeem.musicserver.service.MusiclistService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "歌单管理",description = "歌单创建，列表查看，修改，删除等操作")
@CrossOrigin
@RestController
public class MusiclistController {

    @Autowired
    private MusiclistService musiclistService;

    @Operation(summary = "查询所有歌单",description = "查询所有的歌单数据，为歌曲加入歌单提供数据接口")
    @GetMapping("/musiclist/listAll")
    public R queryAll(){
        List<Musiclist> list = musiclistService.list();
        return R.ok().setData(list);
    }

}
